package com.zbkj.crmeb.system.service;

import com.common.PageParamRequest;
import com.zbkj.crmeb.chant.dto.ChannelMerchantDTO;
import com.zbkj.crmeb.system.model.SystemConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.crmeb.system.request.PaymentAccountRequest;
import com.zbkj.crmeb.system.request.SystemFormCheckRequest;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author Mr.Zhang
* @Description SystemConfigService 接口
* @since 2020-04-13
*/
public interface SystemConfigService extends IService<SystemConfig> {
    List<SystemConfig> getList(PageParamRequest pageParamRequest);

    String getValueByKey(String key);

    /**
     * 同时获取多个配置
     * @param keys 多个配置key
     * @return 查询到的多个结果
     */
    List<String> getValuesByKes(List<String> keys);

    boolean updateOrSaveValueByName(String name, String value);

    String getValueByKeyException(String key);

    boolean saveForm(SystemFormCheckRequest systemFormCheckRequest);

    HashMap<String, String> info(Integer formId);

    boolean checkName(String name);

    /**
     * 配置平台收款账户
     * @param request
     * @return
     */
    boolean PaymentAccount(PaymentAccountRequest request);

    /**
     * 查询商户配置
     * @param id
     * @param name
     * @return
     */
    SystemConfig getMerchantCustomConfig(Integer id, String name);

    /**
     * 添加商户自定义配置
     * @param id
     * @param entity
     * @return
     */
    boolean addMerchantCustomConfig(Integer id, ChannelMerchantDTO entity);

    /**
     * 更新商户自定义配置
     * @param id
     * @param entity
     * @return
     */
    boolean updateMerchantCustomConfig(Integer id, ChannelMerchantDTO entity);

    /**
     * 查询商户配置
     * @param idList
     * @param name
     * @return
     */
    Map<Integer, String> getMerchantCustomConfigMap(List<Integer> idList, String name);
}
